package com.zhuiyun.pm.client.fb.mapper;

import com.zhuiyun.pm.client.fb.entity.Specs;
import com.zhuiyun.pm.config.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * 属性mapper层
 * @author 温
 * @date 2023/3/14 16:56
 * @parameter
 * @return
 */
public interface SpecsMapper extends BaseMapper<Specs> {
    /**
     * 插入属性
     * @author 温
     * @date 2023/3/14 16:16
     * @parameter [specs, goodsNumber]
     * @return int
     */
    @Insert(" <script>" +
            " insert into client_goods_specs(" +
            " specs," +
            " goods_number," +
            " specs_value" +
            " )" +
            " <foreach item='item' collection='specs' open='values (' separator='),(' close=')'>" +
            " #{item.specs}," +
            " #{goodsNumber}," +
            " #{item.specsValue}" +
            " </foreach>" +
            " </script>")
    int insertSpecsAndGoodsNumber(@Param("specs") List<Specs> specs, @Param("goodsNumber") String goodsNumber);


}
